<template>
    <div>
        <p>{{ foo }}</p>
        <p>{{ foo }}</p>
        <p>{{ result() }}</p>
        <p>{{ result() }}</p>
        <button @click="count++">+</button>
    </div>
</template>

<script setup>
import { computed, ref } from 'vue';
const count = ref(10);

const foo = computed(() => {
    console.log('计算调用');

    return count.value * 10 - 1
})
function result() {
    console.log('方法调用');

    return count.value * 10 - 1
}
</script>

<style scoped></style>